package com.xbw.bookSale.dao;

import com.xbw.bookSale.po.*;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;

public class BookTypeDAO extends BaseDAO {

	public List<BookType> getAllBookTypeList() {

		String sql = "select id,typeName from bookType";
		ResultSet rs = super.query(sql);
		List<BookType> lst = new ArrayList<BookType>();
		try {
			while (rs.next()) {
				BookType bt = new BookType();
				bt.setId(rs.getInt("id"));
				bt.setTypeName(rs.getString("typeName"));

				lst.add(bt);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			super.close();
		}
		return lst;
	}

}
